import React, {useRef, useState} from 'react';
import ProForm, {ModalForm} from "@ant-design/pro-form";
import {QuestionCircleOutlined} from "@ant-design/icons";
import {message} from 'antd';
import {deleteUserGroup} from "@/services/ant-design-pro/users";
import './delete.css';

const DeleteModal = (props) => {
  const {userDelete,setUserDelete,actionRef} = props;
  const {ID} = props
  console.log(ID)

  return (
    <div>

        <ModalForm
          title={null}
          visible={userDelete}
          // destroyOnClose={true}
          onVisibleChange={setUserDelete}
          onFinish={async (values)=>{
            await deleteUserGroup(ID)

              setUserDelete(false)
              message.success('删除成功！')

            actionRef.current?.reload();
          }}
        >
          <ProForm
            submitter={false}
          >
          </ProForm>
          <QuestionCircleOutlined />
          <p>
            <h2>删除文章分类</h2>
            <p>确定要删除商品吗？</p>
            <p>删除商品后将无法恢复，请谨慎操作</p>
          </p>
        </ModalForm>

    </div>
  );
};

export default DeleteModal;
